Skip to content

Add draw agent for let-fate-decide#134

Open
tob-joe wants to merge 2 commits intomainfrom
tob-joe/tarot-agent
Open

Add draw agent for let-fate-decide#134
tob-joe wants to merge 2 commits intomainfrom
tob-joe/tarot-agent

Conversation

@tob-joe
Copy link
Copy Markdown

@tob-joe tob-joe commented Mar 26, 2026

Summary

  • Adds agents/draw.md to the let-fate-decide plugin
  • Named agent runs on Haiku (model: haiku in frontmatter) for cheap tarot draws
  • Callers use Agent(subagent_type="let-fate-decide:draw", prompt="question") instead of wrapping Skill(let-fate-decide) in a generic Agent
  • Card file content stays in agent context (not caller's)

Changes (v2)

  • draw_cards.py --content: new flag that reads card .md files and includes their text inline in the JSON output. The draw agent now completes in 1 Bash call instead of 1 Bash + 4 sequential Reads.
  • agents/draw.md: updated to use --content, removed Read from tools list. Agent goes from 5-6 turns to 1 turn per draw.

Problem solved: Haiku ignores <use_parallel_tool_calls> hints and reads the 4 card files sequentially (4 extra turns per draw, ~8-12 wasted turns per vivisect pipeline run with 2-3 draws). By having the Python script read the files directly, no Read calls are needed at all.

Motivation

Skills that draw tarot portents in parallel with other work currently require a 4-line Agent prompt telling the sub-agent to call Skill(let-fate-decide). This named agent replaces that with a 1-line dispatch. Running on Haiku saves cost since card interpretation is simple work.

Test plan

  • uv run scripts/draw_cards.py --content outputs JSON with "content" field containing card markdown
  • uv run scripts/draw_cards.py (no flag) still outputs JSON without content (backward compatible)
  • Agent(subagent_type="let-fate-decide:draw", prompt="What portent awaits?") returns a 1-2 sentence reading
  • Draw agent completes in exactly 1 tool call (Bash), not 5-6
  • Card content does NOT appear in the caller's context (only the verdict text)

🤖 Generated with Claude Code

Adds agents/draw.md to the let-fate-decide plugin. This
lets callers dispatch tarot draws as a named agent:

  Agent(subagent_type="let-fate-decide:draw",
    prompt="What portent awaits?")

instead of the current Agent-wrapped-Skill pattern:

  Agent(prompt="Call Skill(let-fate-decide, ...)...")

Benefits:
- Runs on Haiku (model: haiku in frontmatter) -- cheaper
  than inheriting the parent model for card interpretation
- Card file content stays in agent context, not caller's
- Caches the draw logic across parallel tarot agents
  (shared prefix optimization)
- Simplifies dispatch from 4-line prompt to 1-line

The agent does exactly: Bash(draw_cards.py) -> Read(4
card files) -> return 1-2 sentence reading. Falls back
to "fate unavailable" if the script errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review.

Tip: disable this comment in your organization's Code Review settings.

draw_cards.py --content reads card .md files and includes
their text in the JSON output. The draw agent now needs
exactly 1 Bash call (was 1 Bash + 4 sequential Reads).

Saves 4 turns per tarot draw (~8-12 turns per vivisect run).
Haiku was ignoring <use_parallel_tool_calls> and reading
cards one at a time; this bypasses the issue entirely.

Removed Read from agent tools list (no longer needed).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant